Integrand size = 35, antiderivative size = 159 \[ \int \frac {\cos ^2(c+d x) \left (A+C \sec ^2(c+d x)\right )}{\sqrt {a+a \sec (c+d x)}} \, dx=\frac {(7 A+8 C) \arctan \left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a+a \sec (c+d x)}}\right )}{4 \sqrt {a} d}-\frac {\sqrt {2} (A+C) \arctan \left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {2} \sqrt {a+a \sec (c+d x)}}\right )}{\sqrt {a} d}-\frac {A \sin (c+d x)}{4 d \sqrt {a+a \sec (c+d x)}}+\frac {A \cos (c+d x) \sin (c+d x)}{2 d \sqrt {a+a \sec (c+d x)}} \]
[Out]
Time = 0.46 (sec) , antiderivative size = 159, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.171, Rules used = {4172, 4107, 4005, 3859, 209, 3880} \[ \int \frac {\cos ^2(c+d x) \left (A+C \sec ^2(c+d x)\right )}{\sqrt {a+a \sec (c+d x)}} \, dx=\frac {(7 A+8 C) \arctan \left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a \sec (c+d x)+a}}\right )}{4 \sqrt {a} d}-\frac {\sqrt {2} (A+C) \arctan \left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {2} \sqrt {a \sec (c+d x)+a}}\right )}{\sqrt {a} d}-\frac {A \sin (c+d x)}{4 d \sqrt {a \sec (c+d x)+a}}+\frac {A \sin (c+d x) \cos (c+d x)}{2 d \sqrt {a \sec (c+d x)+a}} \]
[In]
[Out]
Rule 209
Rule 3859
Rule 3880
Rule 4005
Rule 4107
Rule 4172
Rubi steps \begin{align*} \text {integral}& = \frac {A \cos (c+d x) \sin (c+d x)}{2 d \sqrt {a+a \sec (c+d x)}}+\frac {\int \frac {\cos (c+d x) \left (-\frac {a A}{2}+\frac {1}{2} a (3 A+4 C) \sec (c+d x)\right )}{\sqrt {a+a \sec (c+d x)}} \, dx}{2 a} \\ & = -\frac {A \sin (c+d x)}{4 d \sqrt {a+a \sec (c+d x)}}+\frac {A \cos (c+d x) \sin (c+d x)}{2 d \sqrt {a+a \sec (c+d x)}}+\frac {\int \frac {\frac {1}{4} a^2 (7 A+8 C)-\frac {1}{4} a^2 A \sec (c+d x)}{\sqrt {a+a \sec (c+d x)}} \, dx}{2 a^2} \\ & = -\frac {A \sin (c+d x)}{4 d \sqrt {a+a \sec (c+d x)}}+\frac {A \cos (c+d x) \sin (c+d x)}{2 d \sqrt {a+a \sec (c+d x)}}+(-A-C) \int \frac {\sec (c+d x)}{\sqrt {a+a \sec (c+d x)}} \, dx+\frac {(7 A+8 C) \int \sqrt {a+a \sec (c+d x)} \, dx}{8 a} \\ & = -\frac {A \sin (c+d x)}{4 d \sqrt {a+a \sec (c+d x)}}+\frac {A \cos (c+d x) \sin (c+d x)}{2 d \sqrt {a+a \sec (c+d x)}}+\frac {(2 (A+C)) \text {Subst}\left (\int \frac {1}{2 a+x^2} \, dx,x,-\frac {a \tan (c+d x)}{\sqrt {a+a \sec (c+d x)}}\right )}{d}-\frac {(7 A+8 C) \text {Subst}\left (\int \frac {1}{a+x^2} \, dx,x,-\frac {a \tan (c+d x)}{\sqrt {a+a \sec (c+d x)}}\right )}{4 d} \\ & = \frac {(7 A+8 C) \arctan \left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a+a \sec (c+d x)}}\right )}{4 \sqrt {a} d}-\frac {\sqrt {2} (A+C) \arctan \left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {2} \sqrt {a+a \sec (c+d x)}}\right )}{\sqrt {a} d}-\frac {A \sin (c+d x)}{4 d \sqrt {a+a \sec (c+d x)}}+\frac {A \cos (c+d x) \sin (c+d x)}{2 d \sqrt {a+a \sec (c+d x)}} \\ \end{align*}
Time = 0.46 (sec) , antiderivative size = 130, normalized size of antiderivative = 0.82 \[ \int \frac {\cos ^2(c+d x) \left (A+C \sec ^2(c+d x)\right )}{\sqrt {a+a \sec (c+d x)}} \, dx=\frac {\left ((7 A+8 C) \text {arctanh}\left (\sqrt {1-\sec (c+d x)}\right )-4 \sqrt {2} (A+C) \text {arctanh}\left (\frac {\sqrt {1-\sec (c+d x)}}{\sqrt {2}}\right )+A (1-\cos (c+d x)+\cos (2 (c+d x))) \sqrt {1-\sec (c+d x)}\right ) \tan (c+d x)}{4 d \sqrt {1-\sec (c+d x)} \sqrt {a (1+\sec (c+d x))}} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. \(634\) vs. \(2(134)=268\).
Time = 0.77 (sec) , antiderivative size = 635, normalized size of antiderivative = 3.99
method | result | size |
default | \(-\frac {\left (4 A \sqrt {2}\, \ln \left (\sqrt {\cot \left (d x +c \right )^{2}-2 \cot \left (d x +c \right ) \csc \left (d x +c \right )+\csc \left (d x +c \right )^{2}-1}-\cot \left (d x +c \right )+\csc \left (d x +c \right )\right ) \sqrt {-\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\, \cos \left (d x +c \right )+4 C \sqrt {2}\, \ln \left (\sqrt {\cot \left (d x +c \right )^{2}-2 \cot \left (d x +c \right ) \csc \left (d x +c \right )+\csc \left (d x +c \right )^{2}-1}-\cot \left (d x +c \right )+\csc \left (d x +c \right )\right ) \sqrt {-\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\, \cos \left (d x +c \right )+4 A \sqrt {2}\, \sqrt {-\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\, \ln \left (\sqrt {\cot \left (d x +c \right )^{2}-2 \cot \left (d x +c \right ) \csc \left (d x +c \right )+\csc \left (d x +c \right )^{2}-1}-\cot \left (d x +c \right )+\csc \left (d x +c \right )\right )-7 A \sqrt {-\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\, \operatorname {arctanh}\left (\frac {\sin \left (d x +c \right )}{\left (\cos \left (d x +c \right )+1\right ) \sqrt {-\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}}\right ) \cos \left (d x +c \right )-2 A \cos \left (d x +c \right )^{2} \sin \left (d x +c \right )+4 C \sqrt {2}\, \sqrt {-\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\, \ln \left (\sqrt {\cot \left (d x +c \right )^{2}-2 \cot \left (d x +c \right ) \csc \left (d x +c \right )+\csc \left (d x +c \right )^{2}-1}-\cot \left (d x +c \right )+\csc \left (d x +c \right )\right )-8 C \sqrt {-\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\, \operatorname {arctanh}\left (\frac {\sin \left (d x +c \right )}{\left (\cos \left (d x +c \right )+1\right ) \sqrt {-\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}}\right ) \cos \left (d x +c \right )-7 A \sqrt {-\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\, \operatorname {arctanh}\left (\frac {\sin \left (d x +c \right )}{\left (\cos \left (d x +c \right )+1\right ) \sqrt {-\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}}\right )+A \cos \left (d x +c \right ) \sin \left (d x +c \right )-8 C \sqrt {-\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\, \operatorname {arctanh}\left (\frac {\sin \left (d x +c \right )}{\left (\cos \left (d x +c \right )+1\right ) \sqrt {-\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}}\right )\right ) \sqrt {a \left (1+\sec \left (d x +c \right )\right )}}{4 d a \left (\cos \left (d x +c \right )+1\right )}\) | \(635\) |
[In]
[Out]
none
Time = 1.38 (sec) , antiderivative size = 489, normalized size of antiderivative = 3.08 \[ \int \frac {\cos ^2(c+d x) \left (A+C \sec ^2(c+d x)\right )}{\sqrt {a+a \sec (c+d x)}} \, dx=\left [\frac {4 \, \sqrt {2} {\left ({\left (A + C\right )} a \cos \left (d x + c\right ) + {\left (A + C\right )} a\right )} \sqrt {-\frac {1}{a}} \log \left (\frac {2 \, \sqrt {2} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \sqrt {-\frac {1}{a}} \cos \left (d x + c\right ) \sin \left (d x + c\right ) + 3 \, \cos \left (d x + c\right )^{2} + 2 \, \cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right )^{2} + 2 \, \cos \left (d x + c\right ) + 1}\right ) - {\left ({\left (7 \, A + 8 \, C\right )} \cos \left (d x + c\right ) + 7 \, A + 8 \, C\right )} \sqrt {-a} \log \left (\frac {2 \, a \cos \left (d x + c\right )^{2} + 2 \, \sqrt {-a} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \cos \left (d x + c\right ) \sin \left (d x + c\right ) + a \cos \left (d x + c\right ) - a}{\cos \left (d x + c\right ) + 1}\right ) + 2 \, {\left (2 \, A \cos \left (d x + c\right )^{2} - A \cos \left (d x + c\right )\right )} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \sin \left (d x + c\right )}{8 \, {\left (a d \cos \left (d x + c\right ) + a d\right )}}, -\frac {{\left ({\left (7 \, A + 8 \, C\right )} \cos \left (d x + c\right ) + 7 \, A + 8 \, C\right )} \sqrt {a} \arctan \left (\frac {\sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \cos \left (d x + c\right )}{\sqrt {a} \sin \left (d x + c\right )}\right ) - {\left (2 \, A \cos \left (d x + c\right )^{2} - A \cos \left (d x + c\right )\right )} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \sin \left (d x + c\right ) - \frac {4 \, \sqrt {2} {\left ({\left (A + C\right )} a \cos \left (d x + c\right ) + {\left (A + C\right )} a\right )} \arctan \left (\frac {\sqrt {2} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \cos \left (d x + c\right )}{\sqrt {a} \sin \left (d x + c\right )}\right )}{\sqrt {a}}}{4 \, {\left (a d \cos \left (d x + c\right ) + a d\right )}}\right ] \]
[In]
[Out]
\[ \int \frac {\cos ^2(c+d x) \left (A+C \sec ^2(c+d x)\right )}{\sqrt {a+a \sec (c+d x)}} \, dx=\int \frac {\left (A + C \sec ^{2}{\left (c + d x \right )}\right ) \cos ^{2}{\left (c + d x \right )}}{\sqrt {a \left (\sec {\left (c + d x \right )} + 1\right )}}\, dx \]
[In]
[Out]
\[ \int \frac {\cos ^2(c+d x) \left (A+C \sec ^2(c+d x)\right )}{\sqrt {a+a \sec (c+d x)}} \, dx=\int { \frac {{\left (C \sec \left (d x + c\right )^{2} + A\right )} \cos \left (d x + c\right )^{2}}{\sqrt {a \sec \left (d x + c\right ) + a}} \,d x } \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 466 vs. \(2 (134) = 268\).
Time = 1.98 (sec) , antiderivative size = 466, normalized size of antiderivative = 2.93 \[ \int \frac {\cos ^2(c+d x) \left (A+C \sec ^2(c+d x)\right )}{\sqrt {a+a \sec (c+d x)}} \, dx=\frac {\frac {4 \, \sqrt {2} {\left (A + C\right )} \log \left ({\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{2}\right )}{\sqrt {-a} \mathrm {sgn}\left (\cos \left (d x + c\right )\right )} + \frac {{\left (7 \, A + 8 \, C\right )} \log \left ({\left | {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{2} - a {\left (2 \, \sqrt {2} + 3\right )} \right |}\right )}{\sqrt {-a} \mathrm {sgn}\left (\cos \left (d x + c\right )\right )} - \frac {{\left (7 \, A + 8 \, C\right )} \log \left ({\left | {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{2} + a {\left (2 \, \sqrt {2} - 3\right )} \right |}\right )}{\sqrt {-a} \mathrm {sgn}\left (\cos \left (d x + c\right )\right )} + \frac {4 \, \sqrt {2} {\left (17 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{6} A \sqrt {-a} - 57 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{4} A \sqrt {-a} a + 19 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{2} A \sqrt {-a} a^{2} - 3 \, A \sqrt {-a} a^{3}\right )}}{{\left ({\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{4} - 6 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{2} a + a^{2}\right )}^{2} \mathrm {sgn}\left (\cos \left (d x + c\right )\right )}}{8 \, d} \]
[In]
[Out]
Timed out. \[ \int \frac {\cos ^2(c+d x) \left (A+C \sec ^2(c+d x)\right )}{\sqrt {a+a \sec (c+d x)}} \, dx=\int \frac {{\cos \left (c+d\,x\right )}^2\,\left (A+\frac {C}{{\cos \left (c+d\,x\right )}^2}\right )}{\sqrt {a+\frac {a}{\cos \left (c+d\,x\right )}}} \,d x \]
[In]
[Out]